{extend name="public:_base" /}

{block name="js"}
<script type="text/javascript">
    $("[name='status']").find("[value='{$Think.get.status}']").attr("selected", true);
</script>
{/block}

{block name="main"}
<form name="" method="get" action="">
    <div class="text-c">
        <input type="text" name="title" placeholder="{:lang('title')}" style="width:250px" value="{$Think.get.title}" class="input-text">
        <button name="" class="btn radius btn-success" type="submit"><i class="Hui-iconfont"></i> {:lang('Search consulting')}
        </button>
    </div>
</form>
{empty name="$Request.param.toid"}
<div class="cl pd-5 bg-1 bk-gray mt-20">
    <span class="l">

        <a class="btn radius btn-primary radius"
           href="{:url(\''.\\think\\Request::instance()->controller().'/edit',['type'=>$Request.param.type])}">
            <i class="Hui-iconfont">&#xe600;</i>
            {switch name="$Request.param.type" }
                {case value="1" }{:lang('Add to')}-发信给领导{/case}
                {case value="2"}{:lang('Add to')}-心理咨询{/case}
                {case value="3"}{:lang('Add to')}-法律咨询{/case}
                {case value="4"}{:lang('Add to')}-福利待遇咨询{/case}
                {default /}默认情况
            {/switch}
        </a>

    </span>

    <span class="r">
        <i class="glyphicon glyphicon-share-alt"></i>
        {:lang('Total data')}：{$num??'0'}<strong></strong>
    </span>
</div>

<div class="mt-20">
    <table class="table table-border table-bordered table-bg table-hover table-sort">
        <thead>
        <tr class="text-c">
            <th width="100">{:lang('Serial number')}</th>
            <th width="100">{:lang('title')}</th>
            <th width="100">{:lang('Create time')}</th>
            <th width="100">{:lang('status')}</th>
            <th width="100">类型</th>
            <th width="100">{:lang('operating')}</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo" empty="$_html_empty"}
        <tr class="text-c va-m">
            <td>
                {$Think.get.page?(($Think.get.page-1)*$Think.config.paginate.list_rows+$i):($i)}
            </td>
            <td class="text-l">
                {$vo.title}
            </td>
            <td>
                {$vo.create_time}
            </td>
            <td>
                {$vo.status|read_status=$vo.status}
            </td>
            <td>
                {$vo.show?'公开':'私人'}
            </td>
            <td class="td-manage">
                <a style="text-decoration:none" class="btn radius btn-xs btn-success"
                   onClick="edit('查看','','10001')"
                   href="{:url(\''.\\think\\Request::instance()->controller().'/red',['id'=>$vo.id,'toid'=>$Request.param.toid])}"
                   title="{:lang('查看')}">{:lang('查看')}</a>
                <!--<a style="text-decoration:none" class="btn radius btn-xs btn-danger"-->
                <!--onClick="del(this,'{:url(\''.\\think\\Request::instance()->controller().'/del',['id'=>$vo.id])}','10001')"-->
                <!--href="{:url(\''.\\think\\Request::instance()->controller().'/del',['id'=>$vo.id])}"-->
                <!--title="{:lang('delete')}">{:lang('delete')}</a>-->
                <a class="btn radius btn-xs btn-danger" href="javascript:;" onclick="del('{$vo.id}')"
                   title="{:lang('delete')}">{:lang('delete')}</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {else/}
    <div class="cl pd-5 bg-1 bk-gray mt-20">


        <span class="r">{:lang('Total data')}：{$num??'0'}<strong></strong> </span>
    </div>

    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
            <tr class="text-c">
                <th width="20">{:lang('Serial number')}</th>
                <th width="220">{:lang('title')}</th>
                <th width="80">{:lang('Create time')}</th>
                <th width="40">{:lang('status')}</th>
                <th width="40">类型</th>
                <th width="20">{:lang('operating')}</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="vo" empty="$_html_empty"}
            <tr class="text-c va-m">
                <td>
                    {$Think.get.page?(($Think.get.page-1)*$Think.config.paginate.list_rows+$i):($i)}
                </td>
                <td class="text-l">
                    {$vo.title}
                </td>
                <td>
                    {$vo.create_time}
                </td>
                <td>
                    {$vo.status|read_status=$vo.status}
                </td>
                <td>
                    {$vo.show?'公开':'私人'}
                </td>
                <td class="td-manage">
                    <a style="text-decoration:none" class="btn radius btn-xs btn-success"
                       onClick="edit('回复','','10001')"
                       href="{:url(\''.\\think\\Request::instance()->controller().'/toidread',['id'=>$vo.id])}"
                       title="{:lang('查看')}">{:lang('回复')}</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>

    {/empty}
    {$list->render()}
</div>
{/block}